/* 列表 */
var utils = require("../../utils/utils.js");
var api = require("../../api/api.js");
function init() {
  //详情跳转
  var that = this;
  that.onCommodityClick = utils.throttle(function (e) {
    api.default.send_template(e);
    wx.navigateTo({
      url: '../detail/detail?commodity_id=' + e.currentTarget.id,
    });
  })
  //选择规格
  that.showModal = function (e) {
    let id = e.currentTarget.dataset.id;
    api.default.api('get_commodity_detail', { "commodity_id": id }, function (data) {
      that.modalContainer.showModalContainer(data);
      that.setData({
        isScroll: true
      })
    }, function () { });
  }


};

module.exports = {
  init: init
};